package com.woniu.teachmall04.config;

import com.woniu.teachmall04.service.admin.AdminService;
import com.woniu.teachmall04.service.admin.AdminServicrProxy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class AdminServiceConfig {
    /**
     * 标记代理服务为主要Bean，在自动注入时优先使用代理
     */
    @Bean
    @Primary
    public AdminService adminService(AdminServicrProxy proxy) {
        return proxy;
    }
}
